package com.gxar.uaa.server.base.controller;

import com.gxar.common.entity.Result;
import com.gxar.uaa.api.dto.menu.SysMenu;
import com.gxar.uaa.server.base.dubbo.IUserClientImpl;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author linsy
 * @version 1.0
 * @created 2024/3/7 11:35
 */
@Api(tags = "测试接口")
@RestController
@RequestMapping("/admin/api/test")
@RequiredArgsConstructor
@Slf4j
public class TestController {

    private final IUserClientImpl userClient;

    @GetMapping("/user")
    public Result<List<SysMenu>> findMenuByUserId(@RequestParam("app") String app, @RequestParam("userId") Long userId, @RequestParam("type") Integer type) {
        List<SysMenu> menuByUserId = userClient.findMenuByUserId(app, userId, type);
        return Result.success(menuByUserId);
    }

}
